package system

import (
	"gin-admin/handler"
	"gin-admin/middleware"

	"github.com/gin-gonic/gin"
)

func RegisterUserRoutes(group *gin.RouterGroup) {
	userGroup := group.Group("/user")
	handlerApp := handler.NewHandlerApp(nil)
	{
		userGroup.GET("/list", handlerApp.V1App.UserHandler.GetUserListHandler)
		userGroup.DELETE("/delete", handlerApp.V1App.UserHandler.DeleteUserHandler)
		userGroup.POST("/register", handlerApp.V1App.UserHandler.RegisterHandler)
		userGroup.POST("/login", handlerApp.V1App.UserHandler.LoginHandler)
	}
	userGroup.Use(middleware.AuthorizationMiddleware())
	{
		userGroup.POST("/create", handlerApp.V1App.UserHandler.CreateUserHandler)
		userGroup.PUT("/modify", handlerApp.V1App.UserHandler.ModifyUserHandler)
		userGroup.GET("/info/:id", handlerApp.V1App.UserHandler.GetUserInfoHandler)
	}
}
